package com.zhuiyun.project.api.messagelist.service;

import com.zhuiyun.project.api.groupmessage.entity.GroupMessage;
import com.zhuiyun.project.api.joingroup.entity.JoinGroup;
import com.zhuiyun.project.api.messagelist.entity.MessageList;
import com.zhuiyun.project.common.response.CommonResult;

/**
 * @ClassName MessageListService
 * @Description TODO
 * @Author kdj
 * @Date 2023/6/28 14:36
 **/
public interface MessageListService {
    /**
     * @param messageId
     * @Author kdj
     * @Description 更新聊天列表
     * @Date 2023/6/28 14:44
     * @Return java.lang.Integer
     */
    Integer updateChatList(int messageId);

    /**
     * @param fromId
     * @param toUserId
     * @param type
     * @Author kdj
     * @Description 根据fromId和toUserId，type查询到messageList
     * @Date 2023/6/29 14:11
     * @Return com.zhuiyun.project.api.messagelist.entity.MessageList
     */
    MessageList getPerMsgListByTwoId(int fromId, int toUserId, int type);

    /**
     * @param fromId
     * @param toUserId
     * @param type
     * @param num
     * @param type
     * @Author isAdd
     * @Description 根据fromId和toUserId修改未读信息数量
     * @Date 2023/6/29 14:12
     * @Return void
     */
    void upMsgListUmReadZero(int fromId, int toUserId, int type, int num, boolean isAdd);

    /**
     * @param userId
     * @Author kdj
     * @Description 获取聊天列表
     * @Date 2023/6/28 20:23
     * @Return com.zhuiyun.project.common.response.CommonResult
     */
    CommonResult getMsgList(int userId);

    /**
     * @param joinGroup
     * @Author kdj
     * @Description 创建群聊聊天列表
     * @Date 16:58
     * @Return com.zhuiyun.project.api.messagelist.entity.MessageList
     */
    MessageList createGroupMsgList(JoinGroup joinGroup);

    /**
     * @param fromId
     * @param toId
     * @param MsgType
     * @param msgId
     * @Author kdj
     * @Description 修改消息列表的last等消息
     * @Date 2023/7/31 11:11
     * @Return void
     */
    void upMsgListLastInfo(Integer fromId, Integer toId, int MsgType, int msgId, int userId);

    
    /**
    * @Author kdj
    * @Description 撤回群聊消息修改msgList
    * @Date 2023/7/31 17:07
    * @Return void
    * @param groupMessage
    */
    void upMsgGroupListByRecall(GroupMessage groupMessage);
}
